﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Demo_控件样式.View.Tool
{
    /// <summary>
    /// Button1.xaml 的交互逻辑
    /// </summary>
    public partial class Button1 : Canvas
    {
        public Button1()
        {
            InitializeComponent();
        }

        public double BTWidth
        {
            get { return (double)GetValue(BTWidthProperty); }
            set { SetValue(BTWidthProperty, value); }
        }
        public static readonly DependencyProperty BTWidthProperty =
            DependencyProperty.Register("BTWidth", typeof(double), typeof(Button1), new PropertyMetadata(double.NaN));

        public double BTHeight
        {
            get { return (double)GetValue(BTHeightProperty); }
            set { SetValue(BTHeightProperty, value); }
        }
        public static readonly DependencyProperty BTHeightProperty =
            DependencyProperty.Register("BTHeight", typeof(double), typeof(Button1), new PropertyMetadata(double.NaN));

        public string BTContent
        {
            get { return (string)GetValue(BTContentProperty); }
            set { SetValue(BTContentProperty, value); }
        }
        public static readonly DependencyProperty BTContentProperty =
            DependencyProperty.Register("BTContent", typeof(string), typeof(Button1), new PropertyMetadata(""));

        public string BTIsVisible
        {
            get { return (string)GetValue(BTIsVisibleProperty); }
            set { SetValue(BTIsVisibleProperty, value); }
        }
        public static readonly DependencyProperty BTIsVisibleProperty =
            DependencyProperty.Register("BTIsVisible", typeof(string), typeof(Button1), new PropertyMetadata(""));

        public string BTIsMouserColor
        {
            get { return (string)GetValue(BTIsMouserColorProperty); }
            set { SetValue(BTIsMouserColorProperty, value); }
        }
        public static readonly DependencyProperty BTIsMouserColorProperty =
            DependencyProperty.Register("BTIsMouserColor", typeof(string), typeof(Button1), new PropertyMetadata(""));

        public string BTColor
        {
            get { return (string)GetValue(BTColorProperty); }
            set { SetValue(BTColorProperty, value); }
        }
        public static readonly DependencyProperty BTColorProperty =
            DependencyProperty.Register("BTColor", typeof(string), typeof(Button1), new PropertyMetadata(""));

  

        public event RoutedEventHandler Click
        {
            add
            { AddHandler(ClickEvent, value); }
            remove
            { RemoveHandler(ClickEvent, value); }
        }
        public static readonly RoutedEvent ClickEvent =
             EventManager.RegisterRoutedEvent("Click", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(Button1));

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            RoutedEventArgs args = new RoutedEventArgs(ClickEvent, this);
            RaiseEvent(args);
        }

    }
}
